package com.engr.springbooteasypoi.thread;

/**
 * @author : liuYanXin
 * @Description : syn与锁对象
 * @Date : 2020-03-27
 */
public class ThreadCls {

    public static void main(String[] args) {
        for (int i = 0; i < 20; i++) {
            new Thread(new Thread_01()).start();
            new Thread(new Thread_01()).start();
            new Thread(new Thread_01()).start();
        }
    }
}

class Thread_01 extends Thread {

    @Override
    public synchronized void run() {
        for (int i = 0; i < 3; i++) {
            System.out.println(Thread.currentThread().getName() + " run....");
        }
    }
}
